package cn.iocoder.yudao.module.ride.dal.mysql.blacklist;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ride.dal.dataobject.blacklist.BlacklistDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ride.controller.admin.blacklist.vo.*;

/**
 * 黑名单记录 Mapper
 *
 * @author tong
 */
@Mapper
public interface BlacklistMapper extends BaseMapperX<BlacklistDO> {

    default PageResult<BlacklistDO> selectPage(BlacklistPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlacklistDO>()
                .eqIfPresent(BlacklistDO::getUserType, reqVO.getUserType())
                .eqIfPresent(BlacklistDO::getViolationReasonId, reqVO.getViolationReasonId())
                .eqIfPresent(BlacklistDO::getViolationDesc, reqVO.getViolationDesc())
                .orderByDesc(BlacklistDO::getId));
    }

}